package cn.sczhyt.modules.app.controller;

import cn.sczhyt.common.utils.R;
import cn.sczhyt.modules.szhy.entity.MeetingMenuEntity;
import cn.sczhyt.modules.szhy.service.MeetingMenuService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;


/**
 * 会议菜单
 *
 * @author luojialin
 * @email 78357966@qq.com
 * @date 2021-05-18 10:39:50
 */
@Api(tags = "APP端会议菜单")
@RestController
@RequestMapping("app/meetingmenu")
public class AppMeetingMenuController {

    @Autowired
    private MeetingMenuService meetingMenuService;

    /**
     * 列表
     */
    @ApiOperation("获取会议菜单")
    @RequestMapping("/list/{meetingId}")
    public R list(@PathVariable("meetingId") String meetingId){
        System.out.println("获取会议菜单" + meetingId);
        QueryWrapper<MeetingMenuEntity> queryWrapper = new QueryWrapper<>();
        List<MeetingMenuEntity> list = meetingMenuService.list(queryWrapper.eq("meeting_id", meetingId).orderByAsc("menu_sort"));

        return R.ok().put("data", list);
    }

}
